package DesignPattern.Builder.ProtoType.ShallowClone;

import Utils.Util;

public class CitationTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        Citation citation = new Citation();
//        citation.setName("张三");
//        clone.setName("李四");
        Student student = new Student();
        student.setName("张三");
        citation.setStudent(student);

        Citation clone = citation.clone();
        clone.getStudent().setName("李四");
// 浅克隆会导致引用属性相同，因为指向同一内存
        citation.show();
        Util.divide();
        clone.show();
    }
}
